﻿Ext.define('app.prm.inquiry.ViewModel',
{
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.inquiryModel',
    constructor: function () {
        var me = this;
        this.callParent(arguments);
    },
    data: {
        hasAdd: false,
        SubId: 0,
        InquiryId: 0,
        CnName: '',
        CAS: '',
        MF: '',
        MW: '',
        IMG: '',
        status: 0,

        ProjectNo: '',
        CreateOn: new Date(),
        ProjectName: '',
        ProjectType: 'API',
        InquiryNo: '',
        InquiryAbSubId: 0,
        CustomerNo: '',
        //CustomerId: 0,

        CustomerId: '',
        AdminId: '',
        AdminName: '',
        CustomerName: '',
        ProductName: '',
        IsDeveSpecial: '',
        IsDeveSynth: '',
        Phase: '',
        Indication: '',
        IsSafe: false,
        NeedCurNum: '',
        NeedMaxNum: '',
        Purpose: '',
        TargetDate: Ext.Date.add(new Date(), Ext.Date.DAY, 2),
        Files: '',
        TaFiles: ''
    },
    formulas: {
        spec: function (get) {
            return get('IsDeveSpecial') ? "九洲开发" : '客户规格';
        },
        synth: function (get) {
            return get('IsDeveSynth') ? "九洲开发" : '客户工艺';
        },
        hideBtnReTA: function (get) {
            //待工艺评估 = 100,
            //工艺已评估 = 150,
            //待客户反馈 = 200,
            //结束 = 300

            return get("status") > 100 ? false : true;
        },
        hideBtnPending: function (get) {
            return get("status") == 150 ? false : true;
        },
        hideBtnEnd: function (get) {
            return get("status") > 100 ? false : true;
        }
    }
});